const { DataTypes, Model, Sequelize } = require('sequelize')
const { sequelize } = require('../db');

class WordVector extends Model {
    GetVector() {
        return [this.w1, this.w2, this.w3, this.w4, this.w5, this.w6, this.w7, this.w8, this.w9,
        this.w10, this.w11, this.w12, this.w13, this.w14, this.w15, this.w16, this.w17, this.w18, this.w19,
        this.w20, this.w21, this.w22, this.w23, this.w24, this.w25, this.w26, this.w27, this.w28, this.w29,
        this.w30, this.w31, this.w32, this.w33, this.w34, this.w35, this.w36, this.w37, this.w38, this.w39,
        this.w40, this.w41, this.w42, this.w43, this.w44, this.w45, this.w46, this.w47, this.w48, this.w49,
        this.w50]
    }
}

WordVector.init({
    word: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: '单词',
        primaryKey: true
    },
    w1: DataTypes.DOUBLE,
    w2: DataTypes.DOUBLE,
    w3: DataTypes.DOUBLE,
    w4: DataTypes.DOUBLE,
    w5: DataTypes.DOUBLE,
    w6: DataTypes.DOUBLE,
    w7: DataTypes.DOUBLE,
    w8: DataTypes.DOUBLE,
    w9: DataTypes.DOUBLE,
    w10: DataTypes.DOUBLE,
    w11: DataTypes.DOUBLE,
    w12: DataTypes.DOUBLE,
    w13: DataTypes.DOUBLE,
    w14: DataTypes.DOUBLE,
    w15: DataTypes.DOUBLE,
    w16: DataTypes.DOUBLE,
    w17: DataTypes.DOUBLE,
    w18: DataTypes.DOUBLE,
    w19: DataTypes.DOUBLE,
    w20: DataTypes.DOUBLE,
    w21: DataTypes.DOUBLE,
    w22: DataTypes.DOUBLE,
    w23: DataTypes.DOUBLE,
    w24: DataTypes.DOUBLE,
    w25: DataTypes.DOUBLE,
    w26: DataTypes.DOUBLE,
    w27: DataTypes.DOUBLE,
    w28: DataTypes.DOUBLE,
    w29: DataTypes.DOUBLE,
    w30: DataTypes.DOUBLE,
    w31: DataTypes.DOUBLE,
    w32: DataTypes.DOUBLE,
    w33: DataTypes.DOUBLE,
    w34: DataTypes.DOUBLE,
    w35: DataTypes.DOUBLE,
    w36: DataTypes.DOUBLE,
    w37: DataTypes.DOUBLE,
    w38: DataTypes.DOUBLE,
    w39: DataTypes.DOUBLE,
    w40: DataTypes.DOUBLE,
    w41: DataTypes.DOUBLE,
    w42: DataTypes.DOUBLE,
    w43: DataTypes.DOUBLE,
    w44: DataTypes.DOUBLE,
    w45: DataTypes.DOUBLE,
    w46: DataTypes.DOUBLE,
    w47: DataTypes.DOUBLE,
    w48: DataTypes.DOUBLE,
    w49: DataTypes.DOUBLE,
    w50: DataTypes.DOUBLE,
}, {
    sequelize,
    modelName: 'WordVector',
    comment: '词向量表',
    // 不想要 createdAt
    createdAt: false,

    // 想要 updatedAt 但是希望名称叫做 updateTimestamp
    updatedAt: false,
});

module.exports = WordVector;